package com.zhiyizhen.handheld.component.pharmacy.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.zhiyizhen.handheld.R;

/**
 * description
 */
public class OtherDetailLayout extends LinearLayout {

    private TextView typeTv;
    private TextView acupointNameTv;
    private TextView unitTv;


    public OtherDetailLayout(Context context, String type, String acupointName, String unit) {
        super(context);
        initView(context);
        setData(type, acupointName, unit);
    }

    public OtherDetailLayout(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    private void initView(Context context) {
        inflate(context, R.layout.view_other_detail, this);
        setOrientation(LinearLayout.HORIZONTAL);
        typeTv = findViewById(R.id.typeTv);
        acupointNameTv = findViewById(R.id.acupointNameTv);
        unitTv = findViewById(R.id.unitTv);
    }

    private void setData(String type, String acupointName, String unit) {
        typeTv.setText(type);
        acupointNameTv.setText(acupointName);
        unitTv.setText(unit);
    }

}